#include <iostream>
using std::cout;
using std::endl;


class Line
{
/* public: */
    class Point
    {
    public:
        Point(int x,int y)
            : _ix(x)
              , _iy(y)
        {
            cout << "Point(int,int)" << endl;
        }

        ~Point(){
            cout << "~Point()" << endl;
        }

        void print() const{
            cout << "(" << _ix
                << "," << _iy
                << ")";
        }

        void func(const Line & rhs){
        //在内部类中访问外部类的公有成员，
        //可以通过外部类对象直接访问
            rhs.printLine();
            rhs._pt1;
            rhs._lll;
            Line::_lll;
            //内部类中可以直接用外部类的
            //静态成员的名字访问到这个成员
            _lll;
        }
        friend class Line;
    private:
        int _ix;
        int _iy;
        static int _iz;
    };
public:
    Line(int x1,int y1,int x2,int y2)
        : _pt1(x1,y1)
          , _pt2(x2,y2)
    {
        cout << "Line(int*4)" << endl;
    }

    ~Line(){
        cout << "~Line()" << endl;
    }

    void func2(){
        _pt1._ix;
        Point::_iz;
        /* _iz; */
    }

    void printLine() const{
        //在外部类中访问内部类的公有成员，
        //可以通过内部类对象直接访问
        _pt1.print();
        cout << "----->";
        _pt2.print();
        cout << endl;
    }
private:
    Point _pt1;
    Point _pt2;
    static int _lll;
};
int Line::Point::_iz = 0;
int Line::_lll = 1;



int gNum = 10;

class Test
{
    void func(){
        gNum;
    }
};




void test0(){
}

int main(void){
    test0();
    return 0;
}
